We remind here the expression of the curvature for a given set of parametric equations $(x(t), y(t))$ : $$ c(t) = \frac{x'(t) y''(t) - y'(t) x''(t) }{\left(x'(t)^2 + y'(t)^2 \right)^{3/2}}$$

Let : $$ x(t) = t R_0 \cos\frac{\pi}{4}$$ $$ y(t) = 2 R_0 \mathrm{sech}\left( \frac{x(t)}{R_0} \right) = \frac{2 R_0}{\cosh\left( \frac{x(t)}{R_0} \right)}$$


In [11]:
from sympy import *

For a nice $\LaTeX$ printing :


In [12]:
init_printing()

Defining the symbolic notations :


In [13]:
t, r, a, b = symbols('t r a b')

In [14]:
x = -r * sin(t*pi/4)
y = a/cosh(sin(t*pi/4))+b

In [25]:
(diff(y,t)+1).subs(t,-1)


Out[25]:
$$\frac{\sqrt{2} \pi a \sinh{\left (\frac{\sqrt{2}}{2} \right )}}{8 \cosh^{2}{\left (\frac{\sqrt{2}}{2} \right )}} + 1$$

In [26]:
solve(_, a)


Out[26]:
$$\begin{bmatrix}- \frac{4 \sqrt{2} \cosh^{2}{\left (\frac{\sqrt{2}}{2} \right )}}{\pi \sinh{\left (\frac{\sqrt{2}}{2} \right )}}\end{bmatrix}$$
x,y

Calculating the differential expressions


In [49]:
xp = diff(x, t)
yp = diff(y, t).simplify()
xpp = diff(xp, t)
ypp = diff(yp, t).simplify()

In [50]:
xp, yp, xpp, ypp


Out[50]:
$$\begin{pmatrix}- \frac{\pi r}{4} \cos{\left (\frac{\pi t}{4} \right )}, & - \frac{\pi a \cos{\left (\frac{\pi t}{4} \right )} \sinh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}{4 \cosh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}, & \frac{\pi^{2} r}{16} \sin{\left (\frac{\pi t}{4} \right )}, & \frac{\pi^{2} a}{16 \cosh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}} \left(\sin{\left (\frac{\pi t}{4} \right )} \tanh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} + \cos^{2}{\left (\frac{\pi t}{4} \right )} - \frac{2 \cos^{2}{\left (\frac{\pi t}{4} \right )}}{\cosh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}\right)\end{pmatrix}$$

In [51]:
curvature = (xp * ypp - yp * xpp) / (xp**2 + yp**2)**Rational(3,2)

In [52]:
curvature


Out[52]:
$$\frac{1}{\left(\frac{\pi^{2} a^{2} \cos^{2}{\left (\frac{\pi t}{4} \right )} \sinh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}{16 \cosh^{4}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}} + \frac{\pi^{2} r^{2}}{16} \cos^{2}{\left (\frac{\pi t}{4} \right )}\right)^{\frac{3}{2}}} \left(- \frac{\pi^{3} a r \cos{\left (\frac{\pi t}{4} \right )}}{64 \cosh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}} \left(\sin{\left (\frac{\pi t}{4} \right )} \tanh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} + \cos^{2}{\left (\frac{\pi t}{4} \right )} - \frac{2 \cos^{2}{\left (\frac{\pi t}{4} \right )}}{\cosh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}\right) + \frac{\pi^{3} a r \sin{\left (\frac{\pi t}{4} \right )} \cos{\left (\frac{\pi t}{4} \right )}}{64 \cosh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}} \sinh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}\right)$$

In [53]:
curvature.simplify()


Out[53]:
$$- \frac{a r \left(1 - \frac{2}{\cosh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}\right) \cos^{3}{\left (\frac{\pi t}{4} \right )}}{\left(\left(\frac{a^{2} \sinh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}{\cosh^{4}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}} + r^{2}\right) \cos^{2}{\left (\frac{\pi t}{4} \right )}\right)^{\frac{3}{2}} \cosh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}$$

In [54]:
equa = r*cosh(a*t) - 1/curvature

In [55]:
equa.simplify()


Out[55]:
$$\frac{a r^{2} \left(- \left(\sin{\left (\frac{\pi t}{4} \right )} \tanh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} + \cos^{2}{\left (\frac{\pi t}{4} \right )}\right) \cosh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} + \sin{\left (\frac{\pi t}{4} \right )} \sinh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} \cosh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} + 2 \cos^{2}{\left (\frac{\pi t}{4} \right )}\right) \cos{\left (\frac{\pi t}{4} \right )} \cosh{\left (a t \right )} - \left(\left(\frac{a^{2} \sinh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}{\cosh^{4}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}} + r^{2}\right) \cos^{2}{\left (\frac{\pi t}{4} \right )}\right)^{\frac{3}{2}} \cosh^{3}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )}}{a r \left(- \left(\sin{\left (\frac{\pi t}{4} \right )} \tanh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} + \cos^{2}{\left (\frac{\pi t}{4} \right )}\right) \cosh^{2}{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} + \sin{\left (\frac{\pi t}{4} \right )} \sinh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} \cosh{\left (\sin{\left (\frac{\pi t}{4} \right )} \right )} + 2 \cos^{2}{\left (\frac{\pi t}{4} \right )}\right) \cos{\left (\frac{\pi t}{4} \right )}}$$

In [56]:
u = symbols('u')
diff(1/cosh(a*u), u)


Out[56]:
$$- \frac{a \sinh{\left (a u \right )}}{\cosh^{2}{\left (a u \right )}}$$

In [23]:
sinh(-u)


Out[23]:
$$- \sinh{\left (u \right )}$$

In [27]:
cosh(-u)


Out[27]:
$$\cosh{\left (u \right )}$$

In [58]:
1/cosh(-sqrt(2)/2)


Out[58]:
$$\frac{1}{\cosh{\left (\frac{\sqrt{2}}{2} \right )}}$$

In [64]:
f = Function('f')(t)
diff(a/cosh(f/r)+b, t)


Out[64]:
$$- \frac{a \sinh{\left (\frac{1}{r} f{\left (t \right )} \right )} \frac{d}{d t} f{\left (t \right )}}{r \cosh^{2}{\left (\frac{1}{r} f{\left (t \right )} \right )}}$$

In [70]:
diff(-r*sin(t*pi/4),t)


Out[70]:
$$- \frac{\pi r}{4} \cos{\left (\frac{\pi t}{4} \right )}$$

In [71]:
cosh(a)**2/sinh(a)


Out[71]:
$$\frac{\cosh^{2}{\left (a \right )}}{\sinh{\left (a \right )}}$$

In [74]:
expand(_)


Out[74]:
$$\frac{\cosh^{2}{\left (a \right )}}{\sinh{\left (a \right )}}$$

In [77]:
cosh(sqrt(2)/2)


Out[77]:
$$\cosh{\left (\frac{\sqrt{2}}{2} \right )}$$

In [ ]: